package karma.main;

import net.minecraft.client.Minecraft;
import net.minecraft.src.*;
import net.minecraft.src.forge.*;

public class ItemHellHelm extends ItemArmor implements ISpecialArmor
{
	
	public static boolean worn = false;
	
    public ItemHellHelm(int i, EnumArmorMaterial enumarmormaterial, int j, int k)
    {
        super(i, enumarmormaterial, j, k);
    }
    /**
     * Return an item rarity from EnumRarity
     */
    public EnumRarity getRarity(ItemStack itemstack)
    {
        return mod_KarmaCraft.ENCHANTED;
    }
    
    public static void checkIfWorn(Minecraft minecraft)
    {
        if (minecraft.thePlayer.inventory.armorInventory[3] != null && minecraft.thePlayer.inventory.armorInventory[3].getItem() == mod_KarmaCraft.HellHelm)
        {
        	worn = true;
        	doSpecial(minecraft);
        }
        else
        {
        	worn = false;
        }
    }
	@Override
	public ArmorProperties getProperties(EntityLiving player, ItemStack armor, DamageSource source, double damage, int slot) 
	{
		double d1;
		if (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava)
		{
			d1 = 1;
			armor.damageItem(2, player);
		}
		else
		{
			d1 = 0;
		}
		return new ArmorProperties(0, d1, 0x7fffffff);
	}
	
	public static void doSpecial(Minecraft mc)
	{
		mc.thePlayer.setFire(0);
	}
	
	@Override
	public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) 
	{
		return 0;
	}
	
	@Override
	public void damageArmor(EntityLiving entity, ItemStack stack, DamageSource source, int damage, int slot) 
	{
		
	}
}
